package exercises;

public class Exercise {

	public static boolean IsPalindrome(int aNumber){
		assert(aNumber >= 0);
		
		int reversedNumber = Reverse(aNumber);
		return reversedNumber == aNumber;
	}
	
	private static int Reverse(int aNumber)
	{
		int reversedNumber = 0;		
		
		while(aNumber >= 1)
		{
			reversedNumber *= 10;
			reversedNumber += aNumber % 10;
			aNumber /= 10;
		}
		
		return reversedNumber;
	}

	//Given a string S, find the longest palindromic substring in S
	public static String LongestPalindromicSubstring(String aWord){
		return null;
		
	}
	
	
}
